home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8373 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.netspace.net.au!usenet
  2. From: TorrBoy@Netspace.net.au (Peter J. Torr)
  3. Newsgroups: comp.lang.c++
  4. Subject: Derived class not calling overloaded base class function
  5. Date: 17 Feb 1996 09:24:50 GMT
  6. Organization: Dedicated PSB and Sandra Bullock fan
  7. Message-ID: <4g46t2$3vd@otis.netspace.net.au>
  8. Reply-To: TorrBoy@netspace.net.au
  9. NNTP-Posting-Host: dialup-a1-20.mel.netspace.net.au
  10. X-Newsreader: WinVN 0.99.7
  11.  
  12. Hi,
  13.  
  14. Hopefully a very simple question someone can answer for me!
  15.  
  16. I have a class, say 'foo' (everyone's favourite) which has a member function 
  17. 'int Get(void)'
  18.  
  19. I then derive a class (say 'goo') which has as a base class foo. If goo has a 
  20. function also called Get, but with different params (say ''char *Get(char *)') I can't 
  21. seem to get the base class' Get() function to operate within the derived class.
  22.  
  23. If I say just plain "Get()" it says too few parameters (for Get(char *)". If I use 
  24. "::Get()" the compiler complains Get should have a prototype. If I say "foo.Get()" it 
  25. says improper use of typedef foo. The only way seems to be to explicitly cast the 
  26. this pointer to a foo.
  27.  
  28. Surely there is a better way than this? Thanks for any help (e-mail preferred)
  29.  
  30. Peter
  31.  
  32. -- 
  33. IF YOU USE MICROSOFT(r) EXCHANGE, YOU CAN RECEIVE MAIL IN RTF 
  34. FORMAT.
  35. Peter J. Torr
  36. TorrBoy@NetSpace.Net.AU
  37. Shit! This signature violates the Communications Decency Act!
  38.  
  39.